#!/bin/bash

in1=$1
in2=$2
diff=diff

if test -z "$3"; then
  echo "using colordiff" >&2
  diff=colordiff
fi

#used for comparing dmesg type of files that contain only the i8042 parts as a result of i8042.debug kernel cmdline being in effect

splitify() {
  cat "$1" | cut -d ']' -f3-
}

$diff -up5 -w -b -B -Z -a -- <(splitify "$in1") <(splitify "$in2") | less -R

# |grep -ve '^\(+++\|---\) '
# ^ this won't trigger colordiff though

